import { Injectable } from '@nestjs/common';
import { EventEmitter2 } from '@nestjs/event-emitter';
import { Cron } from '@nestjs/schedule';

@Injectable()
export class ScheduleService {
	constructor(private eventEmitter: EventEmitter2){}

	@Cron('0 5 * * *') // 在每天凌晨5点触发任务
	async dayScheduleTask() {
		//发放血战八方排行奖励
		this.eventEmitter.emit("rank.rewards.xuezhanbafang")
	}

	@Cron('*/10 * * * * *') //
	async test() {
		//发放血战八方排行奖励
		// this.eventEmitter.emit("rank.rewards.xuezhanbafang")
	}
}
